10 REM PROGRAM TO PRINT TRACK AND SECTOR ADDRESSES OF GROUPS
20 REM ON A STANDARD CPM DISK. ALL VALUES ARE DECIMAL.
30 REM
40 REM WRITTEN BY M.NICHOLS
50 REM
60 DIM A(26)
70 FOR J=1 TO 26
80 READ A(J)
90 NEXT J
100 PRINT
110 PRINT
120 PRINT "ENTER GROUP NUMBER (DECIMAL) OR 999 TO END"
130 INPUT G
140 IF G=999 THEN GOTO 410
150 REM CHECK FOR VALID GROUPS
160 IF G<0 OR G>243 THEN GOTO 340
170 REM GET TRACK NUMBER (ADD 2 BECAUSE WE START ON TRACK 2)
180 T=INT((G*8)/26+2)
190 REM GET THE SECTOR VECTOR
200 I=(G*8) MOD 26
210 REM ADD 1 TO VECTOR SO MATRIX CORRECTLY ADDRESSED
220 I=I+1
230 REM GET SECTOR # FROM MATRIX IN A CIRCULAR FASHION
240 PRINT "GROUP";G
250 FOR J=1 TO 8
260 S=A(I)
270 PRINT " ","TRACK";T;"SECTOR";S
280 I=I+1
290 IF I<=26 THEN GOTO 320
300 T=T+1
310 I=1
320 NEXT J
330 GOTO 100
340 PRINT "GROUP NUMBER IS NOT VALID"
350 GOTO 100
360 REM
370 REM STANDARD INTERLEAVE TABLE FOR CPM
380 REM
390 DATA 1,7,13,19,25,5,11,17,23,3,9,15,21
400 DATA 2,8,14,20,26,6,12,18,24,4,10,16,22
410 END
